{% extends "_layout.html" %}
{% import "component/statistics.njk" as statistics %}

{# 样式代码 #}
{% block style %}
<title>个人资料</title>
<style type="text/css">
    .mui-content>.mui-table-view:first-child{ margin-top: 0 !important;}
    .mui-table-view em{font-size: 14px; color: #808080;}
</style>
{% endblock %}

{# bodyd代码#}
{% block body %}
<div class="mui-content">
    <ul class="mui-table-view">
        <li class="mui-table-view-cell">
            <a>姓名<span class="mui-badge">{{data.name}}</span></a>
        </li>
        <li class="mui-table-view-cell">
            <a>性别<span class="mui-badge">{{data.sex}}</span></a>
        </li>
        <li class="mui-table-view-cell">
            <a>联系电话<span class="mui-badge">{{data.mobile}}</span></a>
        </li>
        <!--<li class="mui-table-view-cell">-->
            <!--<a>所在地区<span class="mui-badge">贵阳</span></a>-->
        <!--</li>-->
        <li class="mui-table-view-cell">
            <a>详细地址<span class="mui-badge">{{data.currentAddress}}</span></a>
        </li>
        <li class="mui-table-view-cell">
            <a>主监护人<span class="mui-badge">{{data.mainGuardianName}} - <em>{{data.relationship}}</em></span></a>
        </li>
        <li class="mui-table-view-cell">
            <a>主监护人联系电话<span class="mui-badge">{{data.mainGuardianMobile}}</span></a>
        </li>
        <li class="mui-table-view-cell">
            <a href="guardian?id={{data.id}}" class="mui-navigate-right">副监护人<span class="mui-badge">{{data.count}}</span></a>
        </li>
    </ul>

    <nav class="mui-bar mui-bar-tab mb-bar-tab xw-border-top">
        <input type="text" id="replay-input" class="mb-replay-btn" placeholder="请输入回复内容">
        <div class="mb-btn-submit">
            <input type="submit" name="submit" value="提交" />
        </div>
    </nav>

</div>
{% endblock %}

{#js代码#}
{% block js %}
<script>
    $(document).ready(function() {
        $("#replay-input").focus(function () {
            var parent = $(this).parent();
            parent.addClass("mui-active");
        });
        $("#replay-input").blur(function () {
            var parent = $(this).parent();
            parent.removeClass("mui-active");
        });
    });

    var id = location.search.substr(4);
    mui(".mb-btn-submit").on('tap','input[type="submit"]',function(){
        var cont = $('#replay-input').val();
        if(cont == ''){
            return mui.toast('请填写评语内容');
        }
        mui.post('/information', {
                id: id,
                content: cont,
                objectType:2,
            },function(data){
                if(data.code!=200){
                    mui.toast('发布失败');
                }else{
                    mui.toast('发布成功');
                    window.location.reload();
                }
            },'json'
        );
    });
</script>
<!--flotdemo-->
{% endblock %}
